<?php

/** regedis as even listener */
Event::listen('menu.pid', function() {
    $list = (array) Scstore::getUserPermissionSession();
    $permissionObj = new Kj\Admin\Models\Permission();
    $permissions = $permissionObj->getAllAccessPermission();
    foreach($list as $key => $value)
    {
        if($value['module'] == ROUTER_M && $value['class'] == ROUTER_C && $value['action'] == ROUTER_A)
        {
            setCurrentPidSidSession($permissions, $value);
        }
    }
    return false;
});